package com.hc.commodity.pojo;

import java.util.Objects;

public class Commodity {
    Integer cid;
    String ctitle;
    String cprice;
    String cimage;

    @Override
    public String toString() {
        return "Commodity{" +
                "cid=" + cid +
                ", ctitle='" + ctitle + '\'' +
                ", cprice='" + cprice + '\'' +
                ", cimage='" + cimage + '\'' +
                '}';
    }

    public Integer getCid() {
        return cid;
    }

    public void setCid(Integer cid) {
        this.cid = cid;
    }

    public String getCtitle() {
        return ctitle;
    }

    public void setCtitle(String ctitle) {
        this.ctitle = ctitle;
    }

    public String getCprice() {
        return cprice;
    }

    public void setCprice(String cprice) {
        this.cprice = cprice;
    }

    public String getCimage() {
        return cimage;
    }

    public void setCimage(String cimage) {
        this.cimage = cimage;
    }

    public Commodity() {
    }

    public Commodity(Integer cid, String ctitle, String cprice, String cimage) {
        this.cid = cid;
        this.ctitle = ctitle;
        this.cprice = cprice;
        this.cimage = cimage;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Commodity commodity = (Commodity) o;
        return Objects.equals(cid, commodity.cid) && Objects.equals(ctitle, commodity.ctitle) && Objects.equals(cprice, commodity.cprice) && Objects.equals(cimage, commodity.cimage);
    }

    @Override
    public int hashCode() {
        return Objects.hash(cid, ctitle, cprice, cimage);
    }
}
